Skip to content

Fix flaky test: cancellationpropagatestotask#19569

Open
T-Gro wants to merge 1 commit intomainfrom
fix/flaky-cancellationpropagatestotask
Open

Fix flaky test: cancellationpropagatestotask#19569
T-Gro wants to merge 1 commit intomainfrom
fix/flaky-cancellationpropagatestotask

Conversation

@T-Gro
Copy link
Copy Markdown
Member

@T-Gro T-Gro commented Apr 10, 2026

Automated fix for flaky test.

Test: FSharp.Core.UnitTests.Control.AsyncType.CancellationPropagatesToTask

Add synchronization to ensure the async computation has actually started
running on the thread pool before cancelling the default token. Without
this, under heavy CI load the thread pool may not schedule the async
within the 1-second wait window, causing the task to never transition
to Canceled state before the timeout.

This mirrors the pattern already used by the CancellationPropagatesToGroup
test which uses a ManualResetEvent for the same purpose.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

✅ No release notes required

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

1 participant